<?php

$_this =& $this;

/* @var $_this View */
/* @var $form FormHelper */
/* @var $editForm EditFormHelper */
/* @var $html HtmlHelper */
/* @var $ehtml EHtmlHelper */
/* @var $javascript JavascriptHelper */
/* @var $jqax JqaxHelper */
/* @var $filterBlock FilterBlock */

?><?=$editForm->create($modelName, array('url'=>("/candidates/{$this->data[$modelName][$PKName]}/tools/appointed/{$this->data['Testing']['id']}"), 'allowInput' => false));?><?php

	?><?=$editForm->startSet();?><?php
		?><?=$editForm->textView(__d($po_domain, 'entity_name', true), $this->data[$modelName]["surname"].' / '.$this->data[$modelName]["name"]);?><?php
		?><?=$editForm->textView(__d($po_domain, 'group', true), $this->data['Group']["name"]);?><?php
		?><?=$editForm->datetimeView(__d($po_domain, 'appointed_tool_date', true), $this->data['Testing']["date"]);?><?php
		?><?=$editForm->textView(__d($po_domain, 'tool', true), $this->data['Test']['name']);?><?php
		?><?=$editForm->textView(__d($po_domain, 'email', true), $this->data[$modelName]["email"]);?><?php
	?><?=$editForm->endSet();?><?php

	$buttons = array();
	$buttons[] = $editForm->back("/candidates/{$this->data[$modelName][$PKName]}/tools/");

	////////////////////////////////////////////////////////////////////////////
    $sum_txt = $editForm->drawAmountTXT($this->data['Test']['price_blank'], 'EP');
    $confirm = false;
    if ($this->data['Testing']['blank_printed'] != "Y") {
        $confirm = sprintf(__d($po_domain, 'confirm_print_blank'.(Auth::o()->is('admin') ? '_for_admin' : ''), true), $sum_txt);
    }
    $buttons[] = $editForm->buttonTag(__d($po_domain, "appointed_tool_print_blank", true), array(
        'action' => $html->url('/candidates/'.$this->data[$modelName][$PKName].'/tools/get_blank/'.$this->data['Testing']['id']),
        'confirm' => $confirm,
	));

	////////////////////////////////////////////////////////////////////////////
    $sum_txt = $editForm->drawAmountTXT($this->data['Test']['price_test'], 'EP');
    $confirm = sprintf(__d($po_domain, 'enter_from_blank'.(Auth::o()->is('admin') ? '_for_admin' : ''), true), $sum_txt);
    $buttons[] = $editForm->buttonTag(__d($po_domain, "appointed_tool_enter_blank", true), array(
        'action' => $html->url('/candidates/'.$this->data[$modelName][$PKName].'/tools/fill_in/'.$this->data['Testing']['id']),
        'confirm' => $confirm,
	));

	////////////////////////////////////////////////////////////////////////////
	if ($this->data['Test']['type'] != 'TEST') {
        $buttons[] = $editForm->buttonTag(__d($po_domain, "appointed_tool_send", true), array(
            'action' => $html->url('/candidates/'.$this->data[$modelName][$PKName].'/tools/send/'.$this->data['Testing']['id']),
    	));
	}

	////////////////////////////////////////////////////////////////////////////
    $sum_txt = $editForm->drawAmountTXT($this->data['Test']['price_test'], 'EP');
    $confirm = sprintf(__d($po_domain, 'start_tool_confirm'.(Auth::o()->is('admin') ? '_for_admin' : ''), true), $sum_txt);
    $buttons[] = $editForm->buttonTag(__d($po_domain, "appointed_tool_start", true), array(
        'action' => $html->url(array(
            'controller' => 'applet',
            'action' => 'go',
            'auth' => $this->data['Testing']['auth_link'],
        )),
        'confirm' => $confirm,
	));
	////////////////////////////////////////////////////////////////////////////

	if (count($buttons)) {
    	?><?=$editForm->cell(implode(' ', $buttons));?><?php
	}

?><?=$editForm->end();?><?php

?>
